home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Dreamweaver 3 / Configuration / Behaviors / Actions / MM_preloadImages.js < prev    next >
Encoding:
Text File  |  1999-12-01  |  929 b   |  18 lines

  1. // Copyright 1998 Macromedia, Inc. All rights reserved.
  2. //Preloads multiple images files in order. Accepts a variable number of args
  3. //(each should be quoted):
  4. //  imgURL   - an image filename, URL encoded. (ex: file.gif, http://www.x.com/y.gif)
  5. //
  6. //Creates a new array of Image objects. With each one, it assigns an image source
  7. //from the argument list. These are downloaded essentially simultaneously into the
  8. //client cache. When the user needs a new image file (for example: they go to the
  9. //next web page), the browser should quickly find this image in the cache.
  10.  
  11. function MM_preloadImages() { //v3.0
  12.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  13.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  14.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  15. }
  16.  
  17. document.VERSION_MM_preloadImages = 3.0; //define latest version number for behavior inspector
  18.